home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIDirectoryService.idl < prev    next >
Text File  |  2006-05-08  |  4KB  |  140 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  26.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsISupports.idl"
  39. #include "nsIFile.idl"
  40.  
  41. /**
  42.  * nsIDirectoryServiceProvider
  43.  *
  44.  * Used by Directory Service to get file locations.
  45.  *
  46.  * @status FROZEN
  47.  */
  48.  
  49. [scriptable, uuid(bbf8cab0-d43a-11d3-8cc2-00609792278c)]
  50. interface nsIDirectoryServiceProvider: nsISupports
  51. {
  52.  /**
  53.   * getFile
  54.   *
  55.   * Directory Service calls this when it gets the first request for
  56.   * a prop or on every request if the prop is not persistent.
  57.   *
  58.   * @param prop         The symbolic name of the file.
  59.   * @param persistent   TRUE - The returned file will be cached by Directory
  60.   *                     Service. Subsequent requests for this prop will
  61.   *                     bypass the provider and use the cache.
  62.   *                     FALSE - The provider will be asked for this prop
  63.   *                     each time it is requested.
  64.   *
  65.   * @return             The file represented by the property.
  66.   *
  67.   */ 
  68.   nsIFile getFile(in string prop, out PRBool persistent);
  69. };
  70.  
  71. /**
  72.  * nsIDirectoryServiceProvider2
  73.  *
  74.  * An extension of nsIDirectoryServiceProvider which allows
  75.  * multiple files to be returned for the given key.
  76.  *
  77.  * @status FROZEN
  78.  */
  79.  
  80. [scriptable, uuid(2f977d4b-5485-11d4-87e2-0010a4e75ef2)]
  81. interface nsIDirectoryServiceProvider2: nsIDirectoryServiceProvider
  82. {
  83.  /**
  84.   * getFiles
  85.   *
  86.   * Directory Service calls this when it gets a request for
  87.   * a prop and the requested type is nsISimpleEnumerator.
  88.   *
  89.   * @param prop         The symbolic name of the file list.
  90.   *
  91.   * @return             An enumerator for a list of file locations.
  92.   *                     The elements in the enumeration are nsIFile
  93.   * @returnCode         NS_SUCCESS_AGGREGATE_RESULT if this result should be
  94.   *                     aggregated with other "lower" providers.
  95.   */
  96.   nsISimpleEnumerator getFiles(in string prop);
  97. };
  98.  
  99. /**
  100.  * nsIDirectoryService
  101.  *
  102.  * @status FROZEN
  103.  */
  104.  
  105. [scriptable, uuid(57a66a60-d43a-11d3-8cc2-00609792278c)]
  106. interface nsIDirectoryService: nsISupports
  107. {
  108.  /**
  109.   * init
  110.   *
  111.   * Must be called. Used internally by XPCOM initialization.
  112.   *
  113.   */
  114.   void init();
  115.  
  116.  /**
  117.   * registerProvider
  118.   *
  119.   * Register a provider with the service.
  120.   *
  121.   * @param prov            The service will keep a strong reference
  122.   *                        to this object. It will be released when
  123.   *                        the service is released.
  124.   *
  125.   */  
  126.   void registerProvider(in nsIDirectoryServiceProvider prov);
  127.   
  128.  /**
  129.   * unregisterProvider
  130.   *
  131.   * Unregister a provider with the service.
  132.   *
  133.   * @param prov            
  134.   *
  135.   */  
  136.   void unregisterProvider(in nsIDirectoryServiceProvider prov);
  137. };
  138.  
  139.  
  140.